package com.example.wanbaqian.adapter;

import android.content.Context;
import android.view.View;

import com.example.wanbaqian.R;
import com.example.wanbaqian.bean.NoticeInfo;
import com.example.wanbaqian.utils.TimeUtils;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;
import com.zhy.autolayout.utils.AutoUtils;

import java.util.List;

/**
 * Created by Administrator on 2017/4/6 0006.
 * 发现消息适配器
 */

public class FindMessageAdapter extends CommonAdapter<NoticeInfo> {
    public FindMessageAdapter(Context context, int layoutId, List<NoticeInfo> datas) {
        super(context, layoutId, datas);
    }

    @Override
    public void onViewHolderCreated(ViewHolder holder, View itemView) {
        super.onViewHolderCreated(holder, itemView);
        AutoUtils.autoSize(itemView);
    }

    @Override
    protected void convert(ViewHolder holder, NoticeInfo item, int position) {
//        holder.setText(R.id.tv_content,item.get());
        holder.setText(R.id.tv_title, item.getNotice_title());
        holder.setText(R.id.tv_time, TimeUtils.getStrTime(item.getPublish_time() + "", ""));
    }
}
